package com.example.mapper;

import com.example.domain.ZoneSoil;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ZoneSoilMapper {

    @Select("select * from wmy.zone_soil")
    List<ZoneSoil> getAll();

    @Select("select * from wmy.zone_soil where zone_id = #{zoneId}")
    ZoneSoil getById(Integer zoneId);

    @Insert("insert into wmy.zone_soil (zone_id, soil_id) values (#{zoneId}, #{soilId})")
    boolean add(ZoneSoil zoneSoil);

    @Update("update wmy.zone_soil set zone_id=#{zoneId},soil_id=#{soilId} where zone_id = #{zoneId}")
    boolean update(ZoneSoil zoneSoil);

    @Delete("delete from wmy.zone_soil where zone_id = #{zoneId}")
    boolean delete(Integer zoneId);

}
